﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AspDataAccessing.aspx.cs"
    Inherits="_513X0018_web08.AspDataAccessing" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <h3>
        Accessing Data with ASP.NET</h3>
    <form id="Form1" runat="server">
    <asp:DataGrid ID="dgColors" runat="server" AutoGenerateColumns="false" Width="200"
        OnItemCreated="ChangeColor" OnEditCommand="dgColors_Edit" OnCancelCommand="dgColors_Cancel"
        OnUpdateCommand="dgColors_Update">
        <Columns>
            <asp:TemplateColumn HeaderText="ID">
                <ItemTemplate>
                    <asp:Label ID="lblID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ID") %>' />
                </ItemTemplate>
            </asp:TemplateColumn>

            <asp:BoundColumn DataField="Color" HeaderText="Color" />
            <asp:EditCommandColumn headertext="Change" EditText="Edit" UpdateText="Change" CancelText="Cancel" />
        </Columns>
        
    </asp:DataGrid>
    </form>
</body>
</html>
